import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { patroltaskinfologVO, patroltaskinfologForm, patroltaskinfologQuery } from '@/api/security/video-patrol/camera-patrol-task-info/types';

/**
 * 查询巡视任务-巡视记录基本信息列表
 * @param query
 * @returns {*}
 */

export const listpatroltaskinfolog = (query?: patroltaskinfologQuery): AxiosPromise<patroltaskinfologVO[]> => {
  return request({
    url: '/camera/patrolTaskInfoLog/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询巡视任务-巡视记录基本信息详细
 * @param cameraPatrolTaskInfoLogId
 */
export const getpatroltaskinfolog = (cameraPatrolTaskInfoLogId: string | number): AxiosPromise<patroltaskinfologVO> => {
  return request({
    url: '/camera/patrolTaskInfoLog/' + cameraPatrolTaskInfoLogId,
    method: 'get'
  });
};

/**
 * 新增巡视任务-巡视记录基本信息
 * @param data
 */
export const addpatroltaskinfolog = (data) => {
  return request({
    url: '/camera/patrolTaskInfoLog',
    method: 'post',
    data: data
  });
};

/**
 * 修改巡视任务-巡视记录基本信息
 * @param data
 */
export const updatepatroltaskinfolog = (data: patroltaskinfologForm) => {
  return request({
    url: '/camera/patrolTaskInfoLog',
    method: 'put',
    data: data
  });
};

/**
 * 删除巡视任务-巡视记录基本信息
 * @param cameraPatrolTaskInfoLogId
 */
export const delpatroltaskinfolog = (cameraPatrolTaskInfoLogId: string | number | Array<string | number>) => {
  return request({
    url: '/camera/patrolTaskInfoLog/' + cameraPatrolTaskInfoLogId,
    method: 'delete'
  });
};
